﻿using UnityEngine;
using System.Collections;

namespace FrenzyIsland.UI
{
    public class UIMessageBoxAddCharacter : MonoBehaviour
    {
        public GameObject itemContainer;

        //imposta il gameobject da visualizzare nella schermata
        public void SetItem(GameObject item)
        {
            item.transform.parent = itemContainer.transform;
            item.transform.localPosition = Vector3.zero;
            item.transform.localScale = Vector3.one;
            item.SetActive(true);
        }

        private bool requireRefresh = false;
        private GameObject item;

        public void Start()
        {
            this.gameObject.name = "MsgBoxItemAdd";
        }

        void Update()
        {
            if( requireRefresh )
            {
                this.gameObject.SetActive(true);
                item.transform.parent = itemContainer.transform;
                item.transform.localPosition = Vector3.zero;
                item.transform.localScale = Vector3.one;

                requireRefresh = false;
            }
        }
        
        public void OK_Click()
        {
            Destroy(this.gameObject);
        }
    }
}